﻿<%@ Page Language="C#" MasterPageFile="~/admin.master" AutoEventWireup="true" Inherits="MediaMonitor.Admin.Media_Mgmt_List"
    Theme="default" Title="Media Management - List of recently added Videos" CodeBehind="media-mgmt-list.aspx.cs" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="Server">
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script src="../rad-scripts/rad.js" type="text/javascript"></script>
    </telerik:RadCodeBlock>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Body" runat="Server">
    <div>  
        <br />
    </div>
    <telerik:RadAjaxPanel ID="radPanel" runat="server" RestoreOriginalRenderDelegate="false">
        <telerik:RadGrid ID="radGrid" runat="server" AllowFilteringByColumn="True" AllowPaging="True"
            AllowSorting="True" GridLines="None" Skin="Hay" OnNeedDataSource="radGrid_NeedDataSource"
            Width="100%" AutoGenerateColumns="false" GroupingSettings-CaseSensitive="false"
            PageSize="20" >
            <MasterTableView DataKeyNames="ProdVersionCode" ExpandCollapseColumn-Groupable="true"
                ExpandCollapseColumn-GroupByExpression="ProductCode" >
                <Columns>
                
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="ProdVersionCode"
                        HeaderText="Version Code" />
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="AdvertiserName" HeaderText="Advertiser Name " />      
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="BrandName" HeaderText="Brand" />
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="ProductName" HeaderText="Product Name" />
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="ProdVersionName"
                        HeaderText="Version Name" />
                         
                    <telerik:GridTemplateColumn SortExpression="ShortVideo" HeaderText="Preview" ItemStyle-Font-Size="Larger" AllowFiltering="false">
                        <ItemTemplate>
                            <a href="javascript:void(0);" onclick="PopupCenter('../sitefiles/video.aspx?pvid=<%#Eval("ProdVersionCode")%>&t=s', '_blank', 350, 280); ">
                                <span style='color: <%# Utility.ToBool(Eval("ShortVideo"))==true ? "green" : "red"%>;'>
                                    <%#Utility.GetYesNo(Utility.ToBool(Eval("ShortVideo")))%>
                                </span></a><span style='display: <%# Utility.ToBool(Eval("ShortVideo"))==true ? "inline" : "none"%>;'>
                                    <asp:LinkButton ID="lnkDelShortVideo" runat="server" ForeColor="Red" OnClientClick="return confirm('Are you sure to delete the preview video file of this Product Version?')"
                                        OnClick="DelShortVideo" CommandArgument='<%#Eval("ProdVersionCode")%>'>[X]</asp:LinkButton>
                                </span>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn SortExpression="FullVideo" HeaderText="Full Video" ItemStyle-Font-Size="Larger"
                        AllowFiltering="false">
                        <ItemTemplate>
                            <a href="javascript:void(0);" onclick="PopupCenter('../sitefiles/video.aspx?pvid=<%#Eval("ProdVersionCode")%>&t=f', '_blank', 350, 280); ">
                                <span style='color: <%# Utility.ToBool(Eval("FullVideo")    )==true ? "green" : "red"%>;'>
                                    <%#Utility.GetYesNo(Utility.ToBool(Eval("FullVideo")))%>
                                </span></a><span style='display: <%# Utility.ToBool(Eval("FullVideo"))==true ? "inline" : "none"%>;'>
                                    <asp:LinkButton ID="lnkDelFullVideo" runat="server" OnClientClick="return confirm('Are you sure to delete the full video file of this Product Version?')"
                                        OnClick="DelFullVideo" ForeColor="Red" CommandArgument='<%#Eval("ProdVersionCode")%>'>[X]</asp:LinkButton>
                                </span>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="LastModifiedDate" HeaderText="Last Modified"
                        HtmlEncode="false" DataFormatString="{0:d}" />
                </Columns>
            </MasterTableView>
            <ClientSettings>
                <Scrolling AllowScroll="false" />
                <ClientEvents OnFilterMenuShowing="filterMenuShowing" />
            </ClientSettings>
            <FilterMenu OnClientShowing="MenuShowing" />
        </telerik:RadGrid> 
    </telerik:RadAjaxPanel>
     
</asp:Content>
